<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>promise.all</title>
</head>
<body>
    <script>
	      function test()
		  {
			 return  new Promise((resolve,reject)=>{
				 setTimeout(()=>{
				   	console.log("异步") 
					resolve();
				 },3000)
			 }) 
		  }
		  //async定义的函数特点是：以同步的流程来执行异步的操作
		  async function demo()
		  {
			  console.log("开始执行");
			  await test()// 等待函数异步执行完毕后，返回一个状态，然后继续往下执行
			  console.log("正在执行");
			  console.log("执行完毕");
		  }
		  demo();
	</script>
</body>
</html>